package cn.com.yusys.yusp.admin.web.rest;

import cn.com.yusys.yusp.admin.service.PropProviderService;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/common/provider")
public class PropProviderServiceResource {

	@Autowired
	private PropProviderService propProviderService;

	@GetMapping("/pathRestore")
	public String pathRestore(String path) throws JsonProcessingException {
		return propProviderService.pathRestore(path);
	}

	/**
	 * 根据属性名获得属性值
	 * @param propName 属性名
	 * @return
	 */
	@GetMapping("/getPropValueByPropName")
	public String getPropValueByPropName(@RequestParam("propName") String propName) {
		return propProviderService.getPropValueByPropName(propName);
	}

}